#ifndef SPEECHENGINE_H
#define SPEECHENGINE_H

#include <QObject>
#include <QThread>
#include <QTimer>
#include <QEventLoop>
#include "gst/gst.h"
#include <gst/app/gstappsrc.h>
#include <QProcess>
#include <QTcpSocket>
#include <QHostAddress>

class festivalStarter : public QObject
{
    Q_OBJECT
    public:
        explicit festivalStarter(QObject *parent = 0);
        ~festivalStarter();

private:
    QProcess *festivalSrv;
};

class speechengine : public QThread
{
    Q_OBJECT
public:
    explicit speechengine(QObject *parent = 0);
    ~speechengine();
    void speechText(QByteArray textToSpeech, int volume);

signals:

public slots:

protected:
    void run();

private:
    GstElement *speeshPipeline, *speechSource, *festival,  *wavparse, *audioconvert, *speechVolume;
    GstElement *speechSink, *speechAmp;
    static void new_pad (GstElement *element,GstPad *pad, gpointer data);
};

#endif // SPEECHENGINE_H
